package com.luanye.enjoy.controller;

import com.luanye.enjoy.service.FollowService;
import com.luanye.enjoy.vo.RespBean;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/follow")
@AllArgsConstructor
public class FollowController {

    private final FollowService followService;


    @PutMapping("/{id}/{isFollow}")
    public RespBean follow(@PathVariable("id") Long userid, @PathVariable("isFollow") Boolean isFollow){
        return followService.follow(userid, isFollow);
    }

    @GetMapping("/or/not/{id}")
    public RespBean isFollow(@PathVariable("id") Long userid){
        return followService.isFollow(userid);
    }

    @GetMapping("/common/{id}")
    public RespBean common(@PathVariable("id") Long id){
        return followService.followCommons(id);
    }

}
